Stupid windows doesn't get feof right, so add test for null read at eof.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 1 Oct 2002 18:37:27 +0000 (18:37 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 1 Oct 2002 18:37:27 +0000 (18:37 +0000)
gpsbabel/gpx.c

index 152ff2194047ff51c5666250514c4266ad343c9c..ce7ad7442ea79242939301140fbe143af6089561 100644 (file)
@@ -195,7 +195,7 @@ gpx_read(void)
 
        while (!done) {
                len = fread(buf, 1, sizeof(buf), fd);
-               done = feof(fd); 
+               done = feof(fd) || !len
                if (!XML_Parse(psr, buf, len, done)) {
                        fatal(MYNAME ": XML parse error at %d: %s\n", 
                                XML_GetCurrentLineNumber(psr),